import Flutter
import UIKit
var flutterViewController: FlutterViewController?

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
    lazy var flutterEngine = FlutterEngine(name: "Vibrator")

    override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        self.flutterEngine.run()
        GeneratedPluginRegistrant.register(with: self.flutterEngine)

        flutterViewController = FlutterViewController(engine: self.flutterEngine, nibName: nil, bundle: nil)

        flutterViewController!.modalPresentationStyle = .custom
        flutterViewController!.modalTransitionStyle = .crossDissolve
        
        self.window = UIWindow(frame: UIScreen.main.bounds)
        self.window.rootViewController = UINavigationController(rootViewController: SplashViewController())
        self.window.makeKeyAndVisible()

        return true
    }
}
